<?php
/*
Template Name: User
*/
?>
<?php get_header(); ?>
<?php get_sidebar(); ?>



	<div id="content">

		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <?php $user_info = get_userdata($post->post_author); ?>
        <h2 class="archive-title"><?php echo $user_info->first_name; ?> <?php echo $user_info->last_name; ?> ( <?php echo $user_info->nickname; ?> )</h2>
		<div class="post" id="post-<?php the_ID(); ?>">
			<div class="entry">
            	
				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
				
				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

			</div>
		</div>
        <?php edit_post_link('edit this entry.', '<p>', '</p>'); ?>
    
    

        <dl>
        <dt>Website</dt>
        <dd><a href="<?php echo $user_info->user_url; ?>"><?php echo $user_info->user_url; ?></a></dd>
        <dt>Email</dt>
        <dd><a href="mailto:<?php echo $user_info->user_email; ?>"><?php echo $user_info->user_email; ?></a></dd>
        </dl>
        
		<?php endwhile; endif; ?>

        <!-- The Loop -->
        <?php  query_posts("author=".$post->post_author); ?>


<h2 class="pagetitle">posts by <?php echo $user_info->nickname; ?></h2>
        <table width="94" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td height="20" colspan="3" bgcolor="#FFFFFF"><div align="center" class="posttimetag">time</div></td>
    </tr>
  <tr>
    <td width="30" height="20" bgcolor="#FFFFFF" class="posttimetag"><div align="center">&#26376;</div></td>
    <td width="30" height="20" bgcolor="#FFFFFF" class="posttimetag"><div align="center">&#26085;</div></td>
    <td width="30" height="20" bgcolor="#FFFFFF" class="posttimetag"><div align="center">&#24180;</div></td>
    </tr>
</table>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<table width="450" height="30" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td width="30" bgcolor="#FFFFFF"><div align="center">
      <?php the_time('n'); ?>
    </div></td>
    <td width="30" bgcolor="#FFFFFF"><div align="center">
      <?php the_time('d'); ?>
    </div></td>
    <td width="30" bgcolor="#FFFFFF"><div align="center">
      <?php the_time('y'); ?>
    </div></td>
    <td width="225" bgcolor="#FFFFFF"><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_permalink(); ?>" rel="bookmark">
   <div style="padding:5px">   <?php the_title(); ?></div></a></td>
    <td bgcolor="#CCCCCC"><div style="padding:5px"><?php the_category(' |');?></div></td>
  </tr>
</table>

  <?php endwhile; else: ?>
     <p><?php _e('No posts by this author.'); ?></p>

	<?php endif; ?>
<!-- End Loop -->
        
    <?php get_footer(); ?>
	</div>